﻿@model AutomatedTestDataManagement.Models.TestScenarioTest

@{
    ViewBag.Title = "Delete";
}

<h2>Delete</h2>

<h3>Are you sure you want to remove @Model.Test.TestName from @Model.TestScenario.ScenarioName?</h3>
<fieldset>
    <legend>TestScenarioTest</legend>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.TestScenario.ScenarioName)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.TestScenario.ScenarioName)
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.Test.TestName)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Test.TestName)
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.TestNumber)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.TestNumber)
    </div>
</fieldset>
@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    <p>
        <input type="hidden" name="ReturnToAction" id="ReturnToAction" value="@ViewBag.ReturnToAction" />
        <input type="submit" value="Delete" /> |
        @if (ViewBag.ScenarioID != null)
        {
            <input type="hidden" name="ScenarioID" id="ScenarioID" value="@ViewBag.ScenarioID" />
            if (ViewBag.SuiteID != null)
            {
                <input type="hidden" name="SuiteID" id ="SuiteID" value="@ViewBag.SuiteID" />
                if (ViewBag.ReturnToAction == "Edit")
                {
                    @Html.ActionLink("Return to Test Scenario", "Edit", "TestScenario", new { id = ViewBag.ScenarioID, suiteID = ViewBag.SuiteID }, null)
                }
                else
                {
                    @Html.ActionLink("Return to Test Scenario", "Delete", "TestScenario", new { id = ViewBag.ScenarioID, suiteID = ViewBag.SuiteID }, null)
                }
            } 
            else
            {
               if(ViewBag.ReturnToAction == "Edit")
               {
                 @Html.ActionLink("Return to Test Scenario", "Edit", "TestScenario", new { id = ViewBag.ScenarioID }, null)
                } 
                else
                {
                   @Html.ActionLink("Return to Test Scenario", "Delete", "TestScenario", new { id = ViewBag.ScenarioID }, null)
               }   
            }
        }
        else 
        {
            if (ViewBag.TestID != null)
            {
                <input type="hidden" name="TestID" id="TestID" value="@ViewBag.TestID" />
                @Html.ActionLink("Return to Test", "Delete", "Test", new { id = ViewBag.TestId }, null)
            }
        }
    @Html.Partial("_TestSuiteNav")

    </p>
}
